from django.db import models

from apps.blogmessage.models import BlogMessage
from apps.users.models import BaseModel, UserProfile


class MessageComments(BaseModel):
    user = models.ForeignKey(UserProfile, on_delete=models.CASCADE, verbose_name="用户")
    blog = models.ForeignKey(BlogMessage, on_delete=models.CASCADE,verbose_name="文章")
    comments = models.CharField(max_length=200,verbose_name="评论内容")
    is_see = models.BooleanField(default=False, verbose_name='是否可见')

    class Meta:
        verbose_name = "文章评论"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.comments

class BlogComments(BaseModel):
    user = models.ForeignKey(UserProfile, on_delete=models.CASCADE, verbose_name="用户")
    blog = models.ForeignKey(BlogMessage, on_delete=models.CASCADE,verbose_name="文章")
    comments = models.CharField(max_length=200,verbose_name="评论内容")
    is_see = models.BooleanField(default=False, verbose_name='是否可见')

    class Meta:
        verbose_name = "博客评论"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.comments
# Create your models here.
